import request from '@/utils/request'

// 获取存储桶列表
export function listBuckets(params) {
  return request({
    url: '/file/bucket/list',
    method: 'get',
    params: params
  })
}

// 创建存储桶
export function createBucket(data) {
  return request({
    url: '/file/bucket/create',
    method: 'post',
    params: data
  })
}

// 删除存储桶
export function deleteBucket(data) {
  return request({
    url: '/file/bucket/delete',
    method: 'delete',
    params: data
  })
}

// 检查存储桶是否存在
export function bucketExists(params) {
  return request({
    url: '/file/bucket/exists',
    method: 'get',
    params: params
  })
}

// 设置存储桶权限
export function setBucketPermission(data) {
  return request({
    url: '/file/bucket/permission',
    method: 'put',
    params: data
  })
}

// 获取存储桶权限
export function getBucketPermission(params) {
  return request({
    url: '/file/bucket/permission',
    method: 'get',
    params: params
  })
}
